package com.huitu.whht.base.core.api.wq.mooop;

import com.huitu.api.rest.AbstractApiResource;
import com.huitu.commons.PageUtils;
import com.huitu.whht.api.core.common.response.ApiResultBuilder;
import com.huitu.whht.api.core.common.annotations.SzyCoreApiResource;
import com.huitu.whht.api.core.common.annotations.SzyCoreApiService;
import com.huitu.whht.api.core.common.response.StatusRespBuilder;
import com.huitu.whht.api.core.common.util.LocalDateTimeUtil;
import java.time.LocalDateTime;
import com.huitu.whht.base.core.api.wq.mooop.entities.WqMooopD;
import com.huitu.whht.base.core.api.wq.mooop.entities.WqMooopDKey;
import com.huitu.whht.base.core.api.wq.mooop.entities.WqMooopDQo;
import com.huitu.whht.base.core.api.wq.mooop.service.IWqMooopDService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;

import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

/**
 * 说明: 测站金属有机物及其他有机物项目数据表API,表名称: WQ_MOOOP_D <br/>
 * 日期: 2019-04-11
 * @author LiuCW
 */
@Component
@SzyCoreApiResource
@Path("wq/mooop/d")
public class WqMooopDResource extends AbstractApiResource {

    private static final Logger LOGGER = LoggerFactory.getLogger(WqMooopDResource.class);

    private static final String UUID = "e3e5f303-06bc-405e-833f-27093f85e87a";

    @Override
    public String getUUID() {
        return UUID;
    }

    @Autowired
    @SzyCoreApiService
    IWqMooopDService wqMooopDService;

    /**
     * @api {get} wq/mooop/d/{stcd:\\w{8}}/{spt}/{prpnm:\\w{1}}/{lynm:\\w{1}}/{wbtp:\\w{1}} [R][G]根据主键查询
     * @apiDescription [G]根据主键查询WQ_MOOOP_D(测站金属有机物及其他有机物项目数据表)数据
     * @apiName (generate)select by primary key
     * @apiGroup WQ_MOOOP_D-测站金属有机物及其他有机物项目数据表
     * @apiVersion 1.0.0
     * @apiSampleRequest wq/mooop/d/61095300/2012-11-05 00:00:00/1/1/1
     * @apiParam   {String}         stcd               【必须】测站编码
     * @apiParam   {Date}           spt                【必须】采样时间
     * @apiParam   {String}         prpnm              【必须】垂线编号
     * @apiParam   {String}         lynm               【必须】层面编号
     * @apiParam   {String}         wbtp               【必须】水体类型
     * @apiSuccess {String}         stcd               测站编码
     * @apiSuccess {String}         prpnm              垂线编号
     * @apiSuccess {String}         lynm               层面编号
     * @apiSuccess {String}         wbtp               水体类型
     * @apiSuccess {Date}           spt                采样时间(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiSuccess {Double}         jjg                甲基汞
     * @apiSuccess {Double}         yjg                乙基汞
     * @apiSuccess {Double}         syjq               四乙基铅
     * @apiSuccess {Double}         djhys              丁基黄原酸
     * @apiSuccess {Double}         bd                 吡啶
     * @apiSuccess {Double}         shhj               水合肼
     * @apiSuccess {Double}         sjy                松节油
     * @apiSuccess {Double}         bbab               苯并（a）芘
     * @apiSuccess {Double}         las                阴离子表面活性剂
     * @apiSuccess {Double}         toc                总有机碳
     * @apiSuccess {Double}         oil                石油类
     * @apiSuccess {Double}         dzhwy              动植物油
     * @apiSuccess {Double}         wnzdslr            微囊藻毒素LR
     * @apiSuccess {Double}         chla               叶绿素a
     * @apiSuccess {String}         nt                 备注
     * @apiSuccess {String}         speRegData         特殊区域
     * @apiSuccess {Date}           ts                 时间戳(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiSuccess {Date}           testComTm          化验完成时间(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiSuccessExample 请求成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "stcd": "61095300",
     * "prpnm": "1",
     * "lynm": "1",
     * "wbtp": "1",
     * "spt": "2012-11-05 00:00:00.0",
     * "jjg": null,
     * "yjg": null,
     * "syjq": null,
     * "djhys": null,
     * "bd": null,
     * "shhj": null,
     * "sjy": null,
     * "bbab": null,
     * "las": 0.025,
     * "toc": null,
     * "oil": 0.005,
     * "dzhwy": null,
     * "wnzdslr": null,
     * "chla": 0.007,
     * "nt": null,
     * "speRegData": "0",
     * "ts": "2014-08-24 15:30:00.0",
     * "testComTm": null
     *  }
     * }
     * @apiUse exceptions
     */
    @GET
    @Path("{stcd:\\w{8}}/{spt}/{prpnm:\\w{1}}/{lynm:\\w{1}}/{wbtp:\\w{1}}")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response selectByPrimaryKey(@PathParam("stcd") String stcd,@PathParam("spt") String spt,@PathParam("prpnm") String prpnm,@PathParam("lynm") String lynm,@PathParam("wbtp") String wbtp) {
        WqMooopDKey pk = new WqMooopDKey();
        pk.setStcd(stcd);
        LocalDateTime.parse(spt,LocalDateTimeUtil.DATE_TIME_FORMATTER_YMD_HMS);
        pk.setPrpnm(prpnm);
        pk.setLynm(lynm);
        pk.setWbtp(wbtp);
        LOGGER.info("根据主键查询 测站金属有机物及其他有机物项目数据表,参数 pk:{}", pk);
        return Response.ok(ApiResultBuilder.create(this, wqMooopDService.selectByPrimaryKey(pk))).build();
    }

    /**
     * @api {post} wq/mooop/d/list [R][G]根据条件查询
     * @apiDescription [G]根据条件查询WQ_MOOOP_D(测站金属有机物及其他有机物项目数据表)数据
     * @apiName (generate)select by filter
     * @apiGroup WQ_MOOOP_D-测站金属有机物及其他有机物项目数据表
     * @apiVersion 1.0.0
     * @apiSampleRequest wq/mooop/d/list
     * @apiParam   {String}         stcd               测站编码
     * @apiParam   {List(String)}   prpnmList          (数组)垂线编号
     * @apiParam   {List(String)}   lynmList           (数组)层面编号
     * @apiParam   {List(String)}   wbtpList           (数组)水体类型
     * @apiParam   {Date}           sptBgTm            (开始时间)采样时间
     * @apiParam   {Date}           sptEdTm            (结束时间)采样时间
     * @apiParam   {Double}         jjgMin             (最小)甲基汞
     * @apiParam   {Double}         jjgMax             (最大)甲基汞
     * @apiParam   {Double}         yjgMin             (最小)乙基汞
     * @apiParam   {Double}         yjgMax             (最大)乙基汞
     * @apiParam   {Double}         syjqMin            (最小)四乙基铅
     * @apiParam   {Double}         syjqMax            (最大)四乙基铅
     * @apiParam   {Double}         djhysMin           (最小)丁基黄原酸
     * @apiParam   {Double}         djhysMax           (最大)丁基黄原酸
     * @apiParam   {Double}         bdMin              (最小)吡啶
     * @apiParam   {Double}         bdMax              (最大)吡啶
     * @apiParam   {Double}         shhjMin            (最小)水合肼
     * @apiParam   {Double}         shhjMax            (最大)水合肼
     * @apiParam   {List(Double)}   sjyList            (数组)松节油
     * @apiParam   {Double}         bbabMin            (最小)苯并（a）芘
     * @apiParam   {Double}         bbabMax            (最大)苯并（a）芘
     * @apiParam   {Double}         lasMin             (最小)阴离子表面活性剂
     * @apiParam   {Double}         lasMax             (最大)阴离子表面活性剂
     * @apiParam   {List(Double)}   tocList            (数组)总有机碳
     * @apiParam   {Double}         oilMin             (最小)石油类
     * @apiParam   {Double}         oilMax             (最大)石油类
     * @apiParam   {List(Double)}   dzhwyList          (数组)动植物油
     * @apiParam   {Double}         wnzdslrMin         (最小)微囊藻毒素LR
     * @apiParam   {Double}         wnzdslrMax         (最大)微囊藻毒素LR
     * @apiParam   {Double}         chlaMin            (最小)叶绿素a
     * @apiParam   {Double}         chlaMax            (最大)叶绿素a
     * @apiParam   {String}         nt                 备注
     * @apiParam   {List(String)}   speRegDataList     (数组)特殊区域
     * @apiParam   {Date}           tsBgTm             (开始时间)时间戳
     * @apiParam   {Date}           tsEdTm             (结束时间)时间戳
     * @apiParam   {Date}           testComTmBgTm      (开始时间)化验完成时间
     * @apiParam   {Date}           testComTmEdTm      (结束时间)化验完成时间
     * @apiSuccess {String}         stcd               测站编码
     * @apiSuccess {String}         prpnm              垂线编号
     * @apiSuccess {String}         lynm               层面编号
     * @apiSuccess {String}         wbtp               水体类型
     * @apiSuccess {Date}           spt                采样时间
     * @apiSuccess {Double}         jjg                甲基汞
     * @apiSuccess {Double}         yjg                乙基汞
     * @apiSuccess {Double}         syjq               四乙基铅
     * @apiSuccess {Double}         djhys              丁基黄原酸
     * @apiSuccess {Double}         bd                 吡啶
     * @apiSuccess {Double}         shhj               水合肼
     * @apiSuccess {Double}         sjy                松节油
     * @apiSuccess {Double}         bbab               苯并（a）芘
     * @apiSuccess {Double}         las                阴离子表面活性剂
     * @apiSuccess {Double}         toc                总有机碳
     * @apiSuccess {Double}         oil                石油类
     * @apiSuccess {Double}         dzhwy              动植物油
     * @apiSuccess {Double}         wnzdslr            微囊藻毒素LR
     * @apiSuccess {Double}         chla               叶绿素a
     * @apiSuccess {String}         nt                 备注
     * @apiSuccess {String}         speRegData         特殊区域
     * @apiSuccess {Date}           ts                 时间戳
     * @apiSuccess {Date}           testComTm          化验完成时间
     * @apiSuccessExample 请求成功:
     * HTTP/1.1 200 OK
     * {
     * "result": [{
     * "stcd": "61095300",
     * "prpnm": "1",
     * "lynm": "1",
     * "wbtp": "1",
     * "spt": "2012-11-05 00:00:00.0",
     * "jjg": null,
     * "yjg": null,
     * "syjq": null,
     * "djhys": null,
     * "bd": null,
     * "shhj": null,
     * "sjy": null,
     * "bbab": null,
     * "las": 0.025,
     * "toc": null,
     * "oil": 0.005,
     * "dzhwy": null,
     * "wnzdslr": null,
     * "chla": 0.007,
     * "nt": null,
     * "speRegData": "0",
     * "ts": "2014-08-24 15:30:00.0",
     * "testComTm": null
     *  }]
     * }
     *
     * @apiSuccessExample 分页请求:
     * request header: Rang={max=50;size=50;field=TS DESC}
     * HTTP/1.1 200 OK
     * {
     * "result": [{
     * "stcd": "61095300",
     * "prpnm": "1",
     * "lynm": "1",
     * "wbtp": "1",
     * "spt": "2012-11-05 00:00:00.0",
     * "jjg": null,
     * "yjg": null,
     * "syjq": null,
     * "djhys": null,
     * "bd": null,
     * "shhj": null,
     * "sjy": null,
     * "bbab": null,
     * "las": 0.025,
     * "toc": null,
     * "oil": 0.005,
     * "dzhwy": null,
     * "wnzdslr": null,
     * "chla": 0.007,
     * "nt": null,
     * "speRegData": "0",
     * "ts": "2014-08-24 15:30:00.0",
     * "testComTm": null
     *  }],
     * "paging": {
     * "count": 3,
     * "total": 120,
     * "finale": false,
     * "index": 1
     * }
     * }
     * @apiUse header_rang
     * @apiUse exceptions
     */
    @POST
    @Path("list")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response selectList(WqMooopDQo filter) {
        PageUtils.startPageFromRang();
        LOGGER.info("根据条件查询 测站金属有机物及其他有机物项目数据表,参数 WqMooopDQo:{}", filter);
        return Response.ok(ApiResultBuilder.create(this, wqMooopDService.selectList(filter))).build();
    }

    /**
     * @api {put} wq/mooop/d [C][G]新增数据
     * @apiPrivate
     * @apiDescription [G]新增WQ_MOOOP_D(测站金属有机物及其他有机物项目数据表)数据
     * @apiName (generate)add data
     * @apiGroup WQ_MOOOP_D-测站金属有机物及其他有机物项目数据表
     * @apiVersion 1.0.0
     * @apiParam   {String}         stcd               【必须】测站编码
     * @apiParam   {String}         prpnm              【必须】垂线编号
     * @apiParam   {String}         lynm               【必须】层面编号
     * @apiParam   {String}         wbtp               【必须】水体类型
     * @apiParam   {Date}           spt                【必须】采样时间(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiParam   {Double}         jjg                甲基汞
     * @apiParam   {Double}         yjg                乙基汞
     * @apiParam   {Double}         syjq               四乙基铅
     * @apiParam   {Double}         djhys              丁基黄原酸
     * @apiParam   {Double}         bd                 吡啶
     * @apiParam   {Double}         shhj               水合肼
     * @apiParam   {Double}         sjy                松节油
     * @apiParam   {Double}         bbab               苯并（a）芘
     * @apiParam   {Double}         las                阴离子表面活性剂
     * @apiParam   {Double}         toc                总有机碳
     * @apiParam   {Double}         oil                石油类
     * @apiParam   {Double}         dzhwy              动植物油
     * @apiParam   {Double}         wnzdslr            微囊藻毒素LR
     * @apiParam   {Double}         chla               叶绿素a
     * @apiParam   {String}         nt                 备注
     * @apiParam   {String}         speRegData         特殊区域
     * @apiParam   {Date}           ts                 时间戳(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiParam   {Date}           testComTm          化验完成时间(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiSuccess {Integer}        status             1:新增成功;0:新增失败.
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据,通常包含新增数据的主键值
     * @apiSampleRequest wq/mooop/d
     * @apiSuccessExample 新增成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":{
     *   "stcd": "61095300",
     *   "spt": "2012-11-05 00:00:00.0",
     *   "prpnm": "1",
     *   "lynm": "1",
     *   "wbtp": "1"
     *      }
     *   }
     * }
     @apiSuccessExample 新增失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":{
     *   "stcd": "61095300",
     *   "spt": "2012-11-05 00:00:00.0",
     *   "prpnm": "1",
     *   "lynm": "1",
     *   "wbtp": "1"
     *      }
     *   }
     * }
     * @apiParamExample {json} 请求示例:
     * {
     * "stcd": "61095300",
     * "prpnm": "1",
     * "lynm": "1",
     * "wbtp": "1",
     * "spt": "2012-11-05 00:00:00.0",
     * "jjg": null,
     * "yjg": null,
     * "syjq": null,
     * "djhys": null,
     * "bd": null,
     * "shhj": null,
     * "sjy": null,
     * "bbab": null,
     * "las": 0.025,
     * "toc": null,
     * "oil": 0.005,
     * "dzhwy": null,
     * "wnzdslr": null,
     * "chla": 0.007,
     * "nt": null,
     * "speRegData": "0",
     * "ts": "2014-08-24 15:30:00.0",
     * "testComTm": null
     * }
     * @apiUse exceptions
     */
    @PUT
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response insert(WqMooopD record) {
        LOGGER.info("新增 测站金属有机物及其他有机物项目数据表,参数 WqMooopD:{}", record);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.insert(wqMooopDService.insertSelective(record),record))).build();
    }

    /**
     * @api {post} wq/mooop/d/insertBatch [C][G]批量新增数据
     * @apiPrivate
     * @apiDescription [G]批量新增WQ_MOOOP_D(测站金属有机物及其他有机物项目数据表)数据
     * @apiName (generate)addBatch data
     * @apiGroup WQ_MOOOP_D-测站金属有机物及其他有机物项目数据表
     * @apiVersion 1.0.0
     * @apiParam   {String}         stcd               【必须】测站编码
     * @apiParam   {String}         prpnm              【必须】垂线编号
     * @apiParam   {String}         lynm               【必须】层面编号
     * @apiParam   {String}         wbtp               【必须】水体类型
     * @apiParam   {Date}           spt                【必须】采样时间(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiParam   {Double}         jjg                甲基汞
     * @apiParam   {Double}         yjg                乙基汞
     * @apiParam   {Double}         syjq               四乙基铅
     * @apiParam   {Double}         djhys              丁基黄原酸
     * @apiParam   {Double}         bd                 吡啶
     * @apiParam   {Double}         shhj               水合肼
     * @apiParam   {Double}         sjy                松节油
     * @apiParam   {Double}         bbab               苯并（a）芘
     * @apiParam   {Double}         las                阴离子表面活性剂
     * @apiParam   {Double}         toc                总有机碳
     * @apiParam   {Double}         oil                石油类
     * @apiParam   {Double}         dzhwy              动植物油
     * @apiParam   {Double}         wnzdslr            微囊藻毒素LR
     * @apiParam   {Double}         chla               叶绿素a
     * @apiParam   {String}         nt                 备注
     * @apiParam   {String}         speRegData         特殊区域
     * @apiParam   {Date}           ts                 时间戳(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiParam   {Date}           testComTm          化验完成时间(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiSuccess {Integer}        status             1:新增成功;0:新增失败.
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据,通常包含新增数据的主键值
     * @apiSampleRequest wq/mooop/d/insertBatch
     * @apiSuccessExample 新增成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":{
     *   "stcd": "61095300",
     *   "spt": "2012-11-05 00:00:00.0",
     *   "prpnm": "1",
     *   "lynm": "1",
     *   "wbtp": "1"
     *      }
     *   }
     * }
     @apiSuccessExample 新增失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":{
     *   "stcd": "61095300",
     *   "spt": "2012-11-05 00:00:00.0",
     *   "prpnm": "1",
     *   "lynm": "1",
     *   "wbtp": "1"
     *      }
     *   }
     * }
     * @apiParamExample {json} 请求示例:
     * [{
     * "stcd": "61095300",
     * "prpnm": "1",
     * "lynm": "1",
     * "wbtp": "1",
     * "spt": "2012-11-05 00:00:00.0",
     * "jjg": null,
     * "yjg": null,
     * "syjq": null,
     * "djhys": null,
     * "bd": null,
     * "shhj": null,
     * "sjy": null,
     * "bbab": null,
     * "las": 0.025,
     * "toc": null,
     * "oil": 0.005,
     * "dzhwy": null,
     * "wnzdslr": null,
     * "chla": 0.007,
     * "nt": null,
     * "speRegData": "0",
     * "ts": "2014-08-24 15:30:00.0",
     * "testComTm": null
     * }]
     * @apiUse exceptions
     */
    @POST
    @Path("insertBatch")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response insertBatch(List<WqMooopD> recordList) {
        LOGGER.info("批量新增 测站金属有机物及其他有机物项目数据表,参数 WqMooopD:[]", recordList);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.insert(wqMooopDService.insertBatch(recordList),recordList))).build();
    }

    /**
     * @api {put} wq/mooop/d/{stcd:\\w{8}}/{spt}/{prpnm:\\w{1}}/{lynm:\\w{1}}/{wbtp:\\w{1}}/update [U][G]根据主键修改
     * @apiPrivate
     * @apiDescription [G]根据主键修改WQ_MOOOP_D(测站金属有机物及其他有机物项目数据表)数据
     * @apiName (generate)update data
     * @apiGroup WQ_MOOOP_D-测站金属有机物及其他有机物项目数据表
     * @apiVersion 1.0.0
     * @apiParam   {String}         stcd               【必须】测站编码
     * @apiParam   {String}         prpnm              【必须】垂线编号
     * @apiParam   {String}         lynm               【必须】层面编号
     * @apiParam   {String}         wbtp               【必须】水体类型
     * @apiParam   {Date}           spt                【必须】采样时间
     * @apiParam   {Double}         jjg                甲基汞
     * @apiParam   {Double}         yjg                乙基汞
     * @apiParam   {Double}         syjq               四乙基铅
     * @apiParam   {Double}         djhys              丁基黄原酸
     * @apiParam   {Double}         bd                 吡啶
     * @apiParam   {Double}         shhj               水合肼
     * @apiParam   {Double}         sjy                松节油
     * @apiParam   {Double}         bbab               苯并（a）芘
     * @apiParam   {Double}         las                阴离子表面活性剂
     * @apiParam   {Double}         toc                总有机碳
     * @apiParam   {Double}         oil                石油类
     * @apiParam   {Double}         dzhwy              动植物油
     * @apiParam   {Double}         wnzdslr            微囊藻毒素LR
     * @apiParam   {Double}         chla               叶绿素a
     * @apiParam   {String}         nt                 备注
     * @apiParam   {String}         speRegData         特殊区域
     * @apiParam   {Date}           ts                 【必须】时间戳
     * @apiParam   {Date}           testComTm          化验完成时间
     * @apiSuccess {Integer}        status             1:修改成功;0:要修改的数据不存在(可能已被删除)
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据
     * @apiSampleRequest wq/mooop/d/61095300/2012-11-05 00:00:00/1/1/1/update
     * @apiSuccessExample 修改成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":null
     *   }
     * }
     * @apiSuccessExample 修改失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":null
     *   }
     * }
     * @apiParamExample {json} 请求示例:
     * {
     * "stcd": "61095300",
     * "prpnm": "1",
     * "lynm": "1",
     * "wbtp": "1",
     * "spt": "2012-11-05 00:00:00.0",
     * "jjg": null,
     * "yjg": null,
     * "syjq": null,
     * "djhys": null,
     * "bd": null,
     * "shhj": null,
     * "sjy": null,
     * "bbab": null,
     * "las": 0.025,
     * "toc": null,
     * "oil": 0.005,
     * "dzhwy": null,
     * "wnzdslr": null,
     * "chla": 0.007,
     * "nt": null,
     * "speRegData": "0",
     * "ts": "2014-08-24 15:30:00.0",
     * "testComTm": null
     * }
     * @apiUse exceptions
     */
    @PUT
    @Path("{stcd:\\w{8}}/{spt}/{prpnm:\\w{1}}/{lynm:\\w{1}}/{wbtp:\\w{1}}/update")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response update(@PathParam("stcd") String stcd,@PathParam("spt") String spt,@PathParam("prpnm") String prpnm,@PathParam("lynm") String lynm,@PathParam("wbtp") String wbtp, WqMooopD record) {
        record.setStcd(stcd);
        LocalDateTime.parse(spt,LocalDateTimeUtil.DATE_TIME_FORMATTER_YMD_HMS);
        record.setPrpnm(prpnm);
        record.setLynm(lynm);
        record.setWbtp(wbtp);
        LOGGER.info("根据主键修改 测站金属有机物及其他有机物项目数据表,参数 WqMooopD:{}", record);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.update(wqMooopDService.updateByPrimaryKey(record)))).build();
    }

    /**
     * @api {put} wq/mooop/d/{stcd:\\w{8}}/{spt}/{prpnm:\\w{1}}/{lynm:\\w{1}}/{wbtp:\\w{1}}/update-selective [U][G]根据主键修改(只修改非null字段)
     * @apiPrivate
     * @apiDescription [G]根据主键修改WQ_MOOOP_D(测站金属有机物及其他有机物项目数据表)数据,只修改非null字段
     * @apiName (generate)update selected data
     * @apiGroup WQ_MOOOP_D-测站金属有机物及其他有机物项目数据表
     * @apiVersion 1.0.0
     * @apiParam   {String}         stcd               测站编码
     * @apiParam   {String}         prpnm              垂线编号
     * @apiParam   {String}         lynm               层面编号
     * @apiParam   {String}         wbtp               水体类型
     * @apiParam   {Date}           spt                采样时间
     * @apiParam   {Double}         jjg                甲基汞
     * @apiParam   {Double}         yjg                乙基汞
     * @apiParam   {Double}         syjq               四乙基铅
     * @apiParam   {Double}         djhys              丁基黄原酸
     * @apiParam   {Double}         bd                 吡啶
     * @apiParam   {Double}         shhj               水合肼
     * @apiParam   {Double}         sjy                松节油
     * @apiParam   {Double}         bbab               苯并（a）芘
     * @apiParam   {Double}         las                阴离子表面活性剂
     * @apiParam   {Double}         toc                总有机碳
     * @apiParam   {Double}         oil                石油类
     * @apiParam   {Double}         dzhwy              动植物油
     * @apiParam   {Double}         wnzdslr            微囊藻毒素LR
     * @apiParam   {Double}         chla               叶绿素a
     * @apiParam   {String}         nt                 备注
     * @apiParam   {String}         speRegData         特殊区域
     * @apiParam   {Date}           ts                 时间戳
     * @apiParam   {Date}           testComTm          化验完成时间
     * @apiSuccess {Integer}        status             1:修改成功;0:要修改的数据不存在(可能已被删除)
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据
     * @apiSampleRequest wq/mooop/d/61095300/2012-11-05 00:00:00/1/1/1/update-selective
     * * @apiSuccessExample 修改成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":null
     *   }
     * }
     * @apiSuccessExample 修改失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":null
     *   }
     * }
     * @apiParamExample {json} 请求示例:
     * {
     * "stcd": "61095300",
     * "prpnm": "1",
     * "lynm": "1",
     * "wbtp": "1",
     * "spt": "2012-11-05 00:00:00.0",
     * "jjg": null,
     * "yjg": null,
     * "syjq": null,
     * "djhys": null,
     * "bd": null,
     * "shhj": null,
     * "sjy": null,
     * "bbab": null,
     * "las": 0.025,
     * "toc": null,
     * "oil": 0.005,
     * "dzhwy": null,
     * "wnzdslr": null,
     * "chla": 0.007,
     * "nt": null,
     * "speRegData": "0",
     * "ts": "2014-08-24 15:30:00.0",
     * "testComTm": null
     * }
     * @apiUse exceptions
     */
    @PUT
    @Path("{stcd:\\w{8}}/{spt}/{prpnm:\\w{1}}/{lynm:\\w{1}}/{wbtp:\\w{1}}/update-selective")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response updateSelective(@PathParam("stcd") String stcd,@PathParam("spt") String spt,@PathParam("prpnm") String prpnm,@PathParam("lynm") String lynm,@PathParam("wbtp") String wbtp, WqMooopD record) {
        record.setStcd(stcd);
        LocalDateTime.parse(spt,LocalDateTimeUtil.DATE_TIME_FORMATTER_YMD_HMS);
        record.setPrpnm(prpnm);
        record.setLynm(lynm);
        record.setWbtp(wbtp);
        LOGGER.info("根据主键修改(只修改非null字段) 测站金属有机物及其他有机物项目数据表,参数 WqMooopD:{}", record);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.update(wqMooopDService.updateByPrimaryKeySelective(record)))).build();
    }

    /**
     * @api {post} wq/mooop/d/updateBatch [U][G]根据主键批量修改(只修改非null字段)
     * @apiPrivate
     * @apiDescription [G]根据批量主键修改WQ_MOOOP_D(测站金属有机物及其他有机物项目数据表)数据,只修改非null字段
     * @apiName (generate)updateBatch selected data
     * @apiGroup WQ_MOOOP_D-测站金属有机物及其他有机物项目数据表
     * @apiVersion 1.0.0
     * @apiParam   {String}         stcd               测站编码
     * @apiParam   {String}         prpnm              垂线编号
     * @apiParam   {String}         lynm               层面编号
     * @apiParam   {String}         wbtp               水体类型
     * @apiParam   {Date}           spt                采样时间
     * @apiParam   {Double}         jjg                甲基汞
     * @apiParam   {Double}         yjg                乙基汞
     * @apiParam   {Double}         syjq               四乙基铅
     * @apiParam   {Double}         djhys              丁基黄原酸
     * @apiParam   {Double}         bd                 吡啶
     * @apiParam   {Double}         shhj               水合肼
     * @apiParam   {Double}         sjy                松节油
     * @apiParam   {Double}         bbab               苯并（a）芘
     * @apiParam   {Double}         las                阴离子表面活性剂
     * @apiParam   {Double}         toc                总有机碳
     * @apiParam   {Double}         oil                石油类
     * @apiParam   {Double}         dzhwy              动植物油
     * @apiParam   {Double}         wnzdslr            微囊藻毒素LR
     * @apiParam   {Double}         chla               叶绿素a
     * @apiParam   {String}         nt                 备注
     * @apiParam   {String}         speRegData         特殊区域
     * @apiParam   {Date}           ts                 时间戳
     * @apiParam   {Date}           testComTm          化验完成时间
     * @apiSuccess {Integer}        status             1:修改成功;0:要修改的数据不存在(可能已被删除)
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据
     * @apiSampleRequest  wq/mooop/d/updateBatch
     * * @apiSuccessExample 修改成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":null
     *   }
     * }
     * @apiSuccessExample 修改失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":null
     *   }
     * }
     * @apiParamExample {json} 请求示例:
     * [{
     * "stcd": "61095300",
     * "prpnm": "1",
     * "lynm": "1",
     * "wbtp": "1",
     * "spt": "2012-11-05 00:00:00.0",
     * "jjg": null,
     * "yjg": null,
     * "syjq": null,
     * "djhys": null,
     * "bd": null,
     * "shhj": null,
     * "sjy": null,
     * "bbab": null,
     * "las": 0.025,
     * "toc": null,
     * "oil": 0.005,
     * "dzhwy": null,
     * "wnzdslr": null,
     * "chla": 0.007,
     * "nt": null,
     * "speRegData": "0",
     * "ts": "2014-08-24 15:30:00.0",
     * "testComTm": null
     * }]
     * @apiUse exceptions
     */
    @POST
    @Path("updateBatch")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response updateBatch(List<WqMooopD> record) {
        LOGGER.info("根据主键批量修改(只修改非null字段) 测站金属有机物及其他有机物项目数据表,参数 WqMooopD:{}", record);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.update(wqMooopDService.updateBatch(record)))).build();
    }

    /**
     * @api {delete} wq/mooop/d/{stcd:\\w{8}}/{spt}/{prpnm:\\w{1}}/{lynm:\\w{1}}/{wbtp:\\w{1}} [D][G]根据主键删除
     * @apiPrivate
     * @apiDescription [G]根据主键删除WQ_MOOOP_D(测站金属有机物及其他有机物项目数据表)数据
     * @apiName (generate)delete by primary key
     * @apiGroup WQ_MOOOP_D-测站金属有机物及其他有机物项目数据表
     * @apiVersion 1.0.0
     * @apiSampleRequest wq/mooop/d/61095300/2012-11-05 00:00:00/1/1/1
     * @apiParam   {String}         stcd               【必须】测站编码
     * @apiParam   {Date}           spt                【必须】采样时间
     * @apiParam   {String}         prpnm              【必须】垂线编号
     * @apiParam   {String}         lynm               【必须】层面编号
     * @apiParam   {String}         wbtp               【必须】水体类型
     * @apiSuccess {Integer}        status             1:删除成功;0:要删除的数据不存在(可能已被删除).
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据
     * @apiSuccessExample 删除成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":null
     *   }
     * }
     * @apiSuccessExample 删除失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":null
     *   }
     * }
     * @apiUse exceptions
     */
    @DELETE
    @Path("{stcd:\\w{8}}/{spt}/{prpnm:\\w{1}}/{lynm:\\w{1}}/{wbtp:\\w{1}}")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response delete(@PathParam("stcd") String stcd,@PathParam("spt") String spt,@PathParam("prpnm") String prpnm,@PathParam("lynm") String lynm,@PathParam("wbtp") String wbtp) {
         WqMooopDKey pk = new WqMooopDKey();
        pk.setStcd(stcd);
        LocalDateTime.parse(spt,LocalDateTimeUtil.DATE_TIME_FORMATTER_YMD_HMS);
        pk.setPrpnm(prpnm);
        pk.setLynm(lynm);
        pk.setWbtp(wbtp);
        LOGGER.info("根据主键删除 测站金属有机物及其他有机物项目数据表,参数 pk:{}", pk);
        Integer rows = wqMooopDService.deleteByPrimaryKey(pk);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.delete(rows))).build();
    }

    /**
     * @api {delete} wq/mooop/d/by-filter [D][G]根据条件删除
     * @apiPrivate
     * @apiDescription [G]根据条件删除WQ_MOOOP_D(测站金属有机物及其他有机物项目数据表)数据
     * @apiName (generate)delete by filter
     * @apiGroup WQ_MOOOP_D-测站金属有机物及其他有机物项目数据表
     * @apiVersion 1.0.0
     * @apiSampleRequest wq/mooop/d/by-filter
     * @apiParam   {String}         stcd               测站编码
     * @apiParam   {List(String)}   prpnmList          (数组)垂线编号
     * @apiParam   {List(String)}   lynmList           (数组)层面编号
     * @apiParam   {List(String)}   wbtpList           (数组)水体类型
     * @apiParam   {Date}           sptBgTm            (开始时间)采样时间
     * @apiParam   {Date}           sptEdTm            (结束时间)采样时间
     * @apiParam   {Double}         jjgMin             (最小)甲基汞
     * @apiParam   {Double}         jjgMax             (最大)甲基汞
     * @apiParam   {Double}         yjgMin             (最小)乙基汞
     * @apiParam   {Double}         yjgMax             (最大)乙基汞
     * @apiParam   {Double}         syjqMin            (最小)四乙基铅
     * @apiParam   {Double}         syjqMax            (最大)四乙基铅
     * @apiParam   {Double}         djhysMin           (最小)丁基黄原酸
     * @apiParam   {Double}         djhysMax           (最大)丁基黄原酸
     * @apiParam   {Double}         bdMin              (最小)吡啶
     * @apiParam   {Double}         bdMax              (最大)吡啶
     * @apiParam   {Double}         shhjMin            (最小)水合肼
     * @apiParam   {Double}         shhjMax            (最大)水合肼
     * @apiParam   {List(Double)}   sjyList            (数组)松节油
     * @apiParam   {Double}         bbabMin            (最小)苯并（a）芘
     * @apiParam   {Double}         bbabMax            (最大)苯并（a）芘
     * @apiParam   {Double}         lasMin             (最小)阴离子表面活性剂
     * @apiParam   {Double}         lasMax             (最大)阴离子表面活性剂
     * @apiParam   {List(Double)}   tocList            (数组)总有机碳
     * @apiParam   {Double}         oilMin             (最小)石油类
     * @apiParam   {Double}         oilMax             (最大)石油类
     * @apiParam   {List(Double)}   dzhwyList          (数组)动植物油
     * @apiParam   {Double}         wnzdslrMin         (最小)微囊藻毒素LR
     * @apiParam   {Double}         wnzdslrMax         (最大)微囊藻毒素LR
     * @apiParam   {Double}         chlaMin            (最小)叶绿素a
     * @apiParam   {Double}         chlaMax            (最大)叶绿素a
     * @apiParam   {String}         nt                 备注
     * @apiParam   {List(String)}   speRegDataList     (数组)特殊区域
     * @apiParam   {Date}           tsBgTm             (开始时间)时间戳
     * @apiParam   {Date}           tsEdTm             (结束时间)时间戳
     * @apiParam   {Date}           testComTmBgTm      (开始时间)化验完成时间
     * @apiParam   {Date}           testComTmEdTm      (结束时间)化验完成时间
     * @apiSuccess {Integer}        status             通常1或者>1:删除成功;0:没有符合条件的数据.
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据
     * @apiSuccessExample 删除成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":null
     *   }
     * }
     * @apiSuccessExample 删除失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":null
     *   }
     * }
     * @apiUse exceptions
     */
    @DELETE
    @Path("by-filter")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response deleteByFilter(WqMooopDQo filter) {
        LOGGER.info("根据条件删除 测站金属有机物及其他有机物项目数据表,参数 WqMooopDQo:{}", filter);
        Integer rows = wqMooopDService.deleteByFilter(filter);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.delete(rows))).build();
    }
}
